//
//  BaseResponseModel.m
//  CQRCBank_iPhone
//
//  Created by magicmac on 12-12-3.
//  Copyright (c) 2012年 magic-point. All rights reserved.
//

#import "BaseResponseModel.h"

@implementation BaseResponseModel

@synthesize respCode;

@synthesize respMsg;

- (void)encodeWithCoder:(NSCoder*)coder
{
    
}

- (id)initWithCoder:(NSCoder*)decoder
{
    if ((self = [super init])){
        
    }
    return self;
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    
}

- (NSMutableDictionary*)getTestModuleDataTypeForAttrs
{
    NSMutableDictionary* dic = [NSMutableDictionary dictionaryWithCapacity:2];

    return dic;
}

- (NSDictionary*)setObjToStringFromDictionary:(NSDictionary *)aDictionary{
    
    NSMutableDictionary* muDic = [NSMutableDictionary dictionaryWithCapacity:5];
    NSArray* allKey = [aDictionary allKeys];
    for(int i = 0; i < [allKey count]; ++i)
    {
        [muDic setObject:[self valueToString:[aDictionary objectForKey:[allKey objectAtIndex:i]]] forKey:[allKey objectAtIndex:i]];
    }
    
   return muDic;
}

/**
 * 把对象转为字符串
 */
- (id) valueToString:(id)value
{
    id str = @"未知类型";
    if([value isKindOfClass:[NSNumber class]])
    {
        str = [value stringValue];
    }
    else if([value isKindOfClass:[NSDecimalNumber class]])
    {
        str = [value stringValue];
    }
    else //if([value isKindOfClass:[NSString class]])
    {
        str = value;
    }
    
    return str;
}


+ (id)instanceFromDictionary:(NSDictionary *)aDictionary{
    return self;
}
@end
